﻿using System.ComponentModel;
using System.Windows.Forms;

namespace Useful.GUI
{
    public class ExDisplayNameAttribute : DisplayNameAttribute
    {
        public int Order { get; private set; }
        public bool ReadOnly { get; private set; }
        public DataGridViewAutoSizeColumnMode AutoSizeColumn { get; private set; }
        public string Format { get; private set; }
        public string ColumnName { get; private set; }

        public ExDisplayNameAttribute(string displayName, int order, DataGridViewAutoSizeColumnMode autoSizeColumn, string format, bool readOnly, string columnName)
            : base(displayName)
        {
            Order = order;
            ReadOnly = readOnly;
            AutoSizeColumn = autoSizeColumn;
            Format = format;
            ColumnName = columnName;
        }

        public ExDisplayNameAttribute(string displayName, int order, DataGridViewAutoSizeColumnMode autoSizeColumn, string format, bool readOnly)
            : this(displayName, order, autoSizeColumn, format, readOnly, null)
        {
        }

        public ExDisplayNameAttribute(string displayName, int order)
            : this(displayName, order, DataGridViewAutoSizeColumnMode.AllCells, null, false, null)
        {
        }

        public ExDisplayNameAttribute(string displayName, int order, DataGridViewAutoSizeColumnMode autoSizeColumn, bool readOnly)
            : this(displayName, order, autoSizeColumn, null, readOnly, null)
        {
        }

        public ExDisplayNameAttribute(string displayName, int order, DataGridViewAutoSizeColumnMode autoSizeColumn)
            : this(displayName, order, autoSizeColumn, null, true, null)
        {
        }
    }
}
